<?php
session_start();
date_default_timezone_set("Asia/Jakarta");
require_once 'koneksi/koneksi.php';
require_once 'kelas/amankanParam.php';
require_once 'kelas/fungsi.php';
//$objFungsi->var_dump($_SESSION);
$dtGet = $objParamAman->getMethod();
$strUrlSearch = BASEURL.'?v=store';
$strUrlSearch .=isset($dtGet['kat'])?"&kat".$dtGet['kat']:'';
$strUrlSearch .=isset($dtGet['merk'])?"&merk".$dtGet['merk']:'';
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <base href="<?php echo BASEURL;?>">
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <script type="text/javascript" src="<?php echo BASEURL; ?>javascript/jquery-1.9.0.js"></script>
  <script type="text/javascript" src="<?php echo BASEURL; ?>javascript/jquery.validate.js"></script>
  <script type="text/javascript">
    var baseUrl = '<?php echo BASEURL; ?>';
  </script>
  <title><?php echo MAINSITENAME; ?></title>
  <link rel="shortcut icon" href="<?php echo BASEURL;?>image/pavicon.png" />
  <link rel="stylesheet" type="text/css" href="<?php echo BASEURL;?>css/index.css" />
  <link rel="stylesheet" type="text/css" href="<?php echo BASEURL;?>css/ikon.css" />

</head>

<body>
  <div id="line">&nbsp;</div>
  <div id="header">
   <div class="frame_header_atas">
     <div class="logo"><a class="logo-site-name" href="<?php echo BASEURL; ?>"><?php echo MAINSITENAME; ?></a></div>
     <div class="frame_login">
       <div class="link_login">&nbsp;</div>
       <div class="keterangan">
       <?php if(isset($_SESSION['userlogin']) && is_array($_SESSION['userlogin']) && count($_SESSION['userlogin'])>3){
        ?>Selamat Datang <a href="<?php echo BASEURL.'index.php?v=myprofile'; ?>"><?php echo $_SESSION['userlogin']['nama']; ?></a> | <a href="<?php echo BASEURL.'proses/pelanggan.php?on=logout' ?>">Logout</a> <?php
       }
       else{ ?>
       
        <form action="<?php echo BASEURL."proses/pelanggan.php?on=login" ?>" method="POST">
          <input placeholder="Username / Email" style="width:120px;" class="text_box_100" name="username"/>
          <input placeholder="Password" type="password" name="password"  class"text_box_100" style="width:80px;"/>
          <input type="submit" value="Login"/>
        </form>
        <a href="<?php echo BASEURL; ?>index.php?v=newaccount">Register</a> | <a href="<?php echo BASEURL.'index.php?v=forgot'; ?>">Lupa Password?</a>
      
      <?php } ?>
      </div>
     </div>
   </div>
   <div class="frame_header_bawah">
     <a href="?v=beranda"><div class="menu_navigasi">home</div></a>
     <a href="?v=about"><div class="menu_navigasi">about us</div></a>
     <a href="?v=store"><div class="menu_navigasi">the store</div></a>
     <a href="?v=cart"><div class="menu_navigasi">cart <?php if(isset($_SESSION['detail_cart']) && is_array($_SESSION['detail_cart']) && count($_SESSION['detail_cart'])>0){
      $totCart = 0;
      foreach ($_SESSION['detail_cart'] as $vCart) {
        $totCart +=$vCart['jumlah_buy'];
      }
      echo "(".$totCart.")";} ?></div></a>
     <a href="?v=carapesan"><div class="menu_navigasi">Cara Pesan</div></a>
     <a href="?v=contact"><div class="menu_navigasi">contact</div></a>
     <div class="search">
       <table width="100%" cellpadding="2" cellspacing="0" border="0">
         <tr>
           <td width="85%"><form action="<?php echo BASEURL.'index.php'; ?>">
            <?php echo isset($dtGet['kat'])?'<input type="hidden" value="'.$dtGet['kat'].'" name="kat">':''; ?>
            <?php echo isset($dtGet['merk'])?'<input type="hidden" value="'.$dtGet['merk'].'" name="merk">':''; ?>
            <input type="hidden" name="v" value="store" />
            <input type="text" name="search" id="search" class="text_box" /><input style="display:none" type="submit"></form></td>
           <td width="15%"><img src="<?php echo BASEURL; ?>image/ico search.png" /></td>
         </tr>
       </table>
     </div>
   </div>
 </div>

 <div id="center">
  <?php 
  $v=isset($_GET['v'])?$_GET['v']:'';
  if($v=="beranda")                 {include "beranda.php";}
  else if($v=="about")              {include "about.php";}
  else if($v=="myprofile")          {include "myprofile.php";}
  else if($v=="activateuser")       {include "activateuser.php";}
  else if($v=="newaccount")         {include "newaccount.php";}
  else if($v=="cart")               {include "cart.php";}
  else if($v=="checkout")           {include "checkout.php";}
  else if($v=="store")              {include "store.php";}
  else if($v=="review_order")       {include "review_order.php";}
  else if($v=="gallery")            {include "gallery.php";}
  else if($v=="contact")            {include "contact.php";}
else if($v=="carapesan")            {include "cara_pemesanan.php";}
else if($v=="info_pengiriman")      {include "informasi_pengiriman.php";}
  else if($v=="cara_pemesanan")     {include "cara_pemesanan.php";}
  else if($v=="ketentuan")          {include "ketentuan.php";}
  else if($v=="detail")             {include "detail.php";}
  else if($v=="faq")                {include "faq.php";}
else if($v=="ordersuccess")         {include "ordersuccess.php";}
  else{include "beranda.php";};
  ?>
</div>

<div id="footer">
<div class="frame_footer_1">
  <div class="informasi">
     <div class="judul_footer1">Informasi</div>
     <div class="isi_footer_1">
       <table width="100%" cellpadding="5" cellspacing="0" border="0">
       
        <tr>
          <td><img src="<?php echo BASEURL; ?>image/ico_login.gif" /></td>
          <td><a href="informasi_pengiriman.php">FAQ</a></td>
        </tr>
        <?php if(defined('FBPAGE') && strlen(FBPAGE)>0){?>
        <tr>
        <td><img src="<?php echo BASEURL; ?>image/ico_login.gif" /></td>
        
        <td><a href="<?php echo FBPAGE; ?>">Facebook</a></td>
        </tr>
        <?php } ?>
      
      </table>
    </div>
  </div>
  </div>

<div id="line_footer_2">
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------</div>
  <div class="frame_footer_2">&copy; <?php echo YEARCOPYRIGHT; ?> <strong><?php echo MAINSITENAME;?></strong> ALL RIGHTS RESERVED</div>
</div>
</body>
</html>
